﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ConsoleTables;
using JsonFormat;
using Newtonsoft.Json;

namespace JsonTest
{
    class Program
    {
        static void test3()
        {
            JsonClass jclass = new JsonClass();
            List<OrderDetailsInsert> orderDetailsInserts = jclass.json2Object();
            Console.WriteLine(orderDetailsInserts.Count);
        }

        static void test4()
        {
            JsonClass jclass = new JsonClass();
            List<Order> orders = jclass.json2Orders();
            var table = new ConsoleTable(
                "orderno", "time", "orderStatus",
                "fullCut", "originalCost","actualPayment");
            foreach (Order order in orders)
            {
                table.AddRow(order.orderno, order.time,
                     order.orderStatus,order.fullCut,
                     order.originalCost,order.actualPayment);
                table.Write();
                Console.WriteLine();
            }
        }

        /// <summary>
        /// 格式化的输出，通过占位符的形式，占位符从0开始。
        /// </summary>
        static void test1()
        {
            Console.WriteLine("{0},{1},{2}", 24, 56, "abc");
        }

        static void Main(string[] args)
        {
            //test3();
            //test4();
            test1();
            Console.ReadKey();
        }
    }
}
